home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / games / nhak_src.zip / MACCONF.H < prev    next >
C/C++ Source or Header  |  1993-03-16  |  5KB  |  229 lines

  1. /*    SCCS Id: @(#)macconf.h    3.0    88/07/21 */
  2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  3. /* Copyright (c) Johnny Lee, 1989         */
  4. /* NetHack may be freely redistributed.  See license for details. */
  5. #ifdef MACOS
  6. #ifndef MACCONF_H
  7. #define MACCONF_H
  8.  
  9. /*
  10.  *  The following options are configurable:
  11.  */
  12.  
  13. #define RANDOM        /* have Berkeley random(3) */
  14.  
  15. #define PATHLEN    220    /* maximum pathlength */
  16. #define FILENAME    31    /* maximum filename length (conservative) */
  17.  
  18. #define glo(x)    name_file(lock, x)    /* name_file used for bones */
  19. #include "msdos.h"    /* contains necessary externs for [os_name].c */
  20. extern char *configfile;
  21. #define NO_SIGNAL
  22. #define    perror(x)
  23.  
  24. /*
  25.  *  The remaining code shouldn't need modification.
  26.  */
  27.  
  28. #ifndef SYSTEM_H
  29. #include "system.h"
  30. #endif
  31.  
  32.  
  33. #ifdef RANDOM
  34. /* Use the high quality random number routines. */
  35. #define Rand()    random()
  36. #define Srand(seed)    srandom(seed)
  37. #else
  38. #define Rand()    rand()
  39. #define Srand(seed)    srand(seed)
  40. #endif /* RANDOM */
  41.  
  42. #ifndef REDO
  43. #undef    Getchar
  44. #define Getchar tgetch
  45. #endif
  46.  
  47. #ifdef THINK_C
  48.  
  49. #define index    strchr
  50. #define rindex    strrchr
  51. #include <time.h>
  52. #define    FCMASK    O_WRONLY | O_BINARY | O_CREAT    /* file creation mask */
  53.  
  54. #ifdef LSC
  55. #include    <types.h>
  56. #include    <io.h>
  57. #define    memcpy(x,y,j)    movmem(y,x,j)
  58. #define memset(x,y,j)    setmem(x,j,y)
  59. extern char *malloc();
  60. extern char    *calloc();
  61. #else
  62. #include    <Fcntl.h>
  63. #include    <Stddef.h>
  64. #include    <Stdlib.h>
  65. #include    <String.h>
  66. #undef getuid
  67. #ifdef CUSTOM_IO
  68. #ifdef stdout
  69. #undef stdout
  70. #define stdout (FILE *)NULL
  71. #endif
  72. #endif
  73. #endif
  74.  
  75. #include    <pascal.h>
  76. #include    <Quickdraw.h>
  77. #include    <FontMgr.h>
  78. #include    <EventMgr.h>
  79. #include    <WindowMgr.h>
  80. #include    <MenuMgr.h>
  81. #include    <StdFilePkg.h>
  82. #include    <SegmentLdr.h>
  83. #include    <ToolboxUtil.h>
  84. #include    <OSUtil.h>
  85. #include    <DialogMgr.h>
  86. #include    <FileMgr.h>
  87. #include    <HFS.h>
  88. #include    <Color.h>
  89. #include    <ResourceMgr.h>
  90.  
  91. #ifdef fflush
  92. #undef    fflush
  93. #define    fflush(x)
  94. #endif
  95.  
  96. /* these two defines for variables in decl.c; they conflict with */
  97. /* variables in Quickdraw.h - the Quickdraw variables are never used in NH */
  98. #define    black    Black
  99. #define    white    White
  100.  
  101.  
  102. #else    /* Aztec and MPW */
  103.  
  104. #ifdef AZTEC
  105. #include    <utime.h>    /* AZTEC 3.6c */
  106. #define    curs(x,y)    tcurs(x,y)
  107. #include    <Types.h>
  108. #define    CtoPstr    ctop
  109. #define    PtoCstr    ptoc
  110. #else
  111. #include    <Time.h>    /* MPW 3.0 */
  112. #include    <Strings.h>
  113. #define    CtoPstr    c2pstr
  114. #define    PtoCstr    p2cstr
  115. #endif
  116.  
  117.  
  118. #include    <Quickdraw.h>
  119. #include    <Fonts.h>
  120. #include    <Events.h>
  121. #include    <Windows.h>
  122. #include    <Menus.h>
  123. #include    <Packages.h>
  124. #include    <SegLoad.h>
  125. #include    <ToolUtils.h>
  126. #include    <OSUtils.h>
  127. #include    <Dialogs.h>
  128. #include    <Files.h>
  129. #include    <Resources.h>
  130. #ifdef MPW
  131. #include    <Script.h>
  132. #include    <SysEqu.h>
  133. #endif
  134. #include    <Signal.h>
  135. #include    <String.h>
  136. #include    <FCntl.h>
  137. #define    FCMASK    O_WRONLY | O_CREAT    /* file creation mask */
  138. #endif
  139.  
  140. /* typdef and defines for special custom termcap routines */
  141. typedef struct term_info {
  142.     short    tcur_x,tcur_y;
  143.     short    fontNum,fontSize;
  144.     short    ascent,descent,height,charWidth;
  145.     short    maxRow,maxCol;
  146.     char    **screen;
  147.     char    **scrAttr;
  148.     char    curHilite;
  149.     char    curAttr;
  150.     short    inColor;
  151.     short    auxFileVRefNum;
  152.     short    recordVRefNum;
  153.     SysEnvRec    system;
  154.     char    *keyMap;
  155.     short    color[8];
  156.     CursHandle    cursor[9];  /* self-contained cursors */
  157.     Handle    shortMBarHandle,
  158.             fullMBarHandle;
  159. } term_info;
  160.  
  161. #define TEXTCOLOR
  162.  
  163. #define    appleMenu    101
  164. #define    fileMenu    102
  165. #define    editMenu    103
  166. #define    inventMenu    104
  167. #define actionMenu    105
  168. #define prepMenu    106
  169. #define    moveMenu    107
  170. #define extendMenu    108
  171.  
  172. #ifdef THINK_C
  173. #define MAINGRAFPORT    thePort
  174. #define    ARROW_CURSOR    arrow
  175. #define    SCREEN_BITS    screenBits
  176. #else
  177. #define MAINGRAFPORT    qd.thePort
  178. #define    ARROW_CURSOR    qd.arrow
  179. #define    SCREEN_BITS    qd.screenBits
  180. #endif
  181.  
  182. /* used in mac.c */
  183. #define Screen_Border    4
  184. #define    TOP_OFFSET        30
  185. #define    LEFT_OFFSET    10
  186.  
  187. /* for macflags variable */
  188. #define    fMoveWRTMouse        0x400
  189. #define    fZoomOnContextSwitch        0x200
  190. #define    fUseCustomFont        0x100
  191. #define    fToggleNumPad        0x80
  192. #define    fInvertedScreen        0x40
  193. #define    fExtCmdSeq1            0x20
  194. #define    fExtCmdSeq2            0x10
  195. #define    fExtCmdSeq3            0x08
  196. #define    fDoNonKeyEvt        0x06
  197. #define    fDoMenus        0x02
  198. #define    fDoUpdate            0x01
  199.  
  200.  
  201. #define    CREATOR    'nh30'
  202. #define    EXPLORE_TYPE    'XPLR'
  203. #define    SAVE_TYPE    'SAVE'
  204. #define    BONES_TYPE    'BONE'
  205. #define    LEVEL_TYPE    'LEVL'
  206. #define    HACK_DATA    'HDTA'
  207. #define AUXIL_TYPE    'AUXL'
  208. #define TEXT_TYPE    'TEXT'
  209. #define MONST_DATA    101
  210. #define OBJECT_DATA    104
  211. #define    DEFAULT_DATA    100
  212.  
  213. #define SEG_ZAP        0x0020
  214. #define SEG_SPELL    0x0010
  215. #define SEG_POTION    0x0008
  216. #define SEG_EAT        0x0004
  217. #define SEG_DO        0x0002
  218. #define SEG_APPLY    0x0001
  219. extern long segments;    /* defined in mac.c */
  220.  
  221. #include "extern.h"
  222.  
  223. # ifndef MACALERT_H
  224. #  include "MacAlert.h"
  225. # endif
  226.  
  227. #endif /* MACCONF_H /* */
  228. #endif /* MACOS / */
  229.